﻿<navigation:Page 
    x:Class="Perspective.Demo.View.ShapeDemo" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:swc="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:p="http://www.codeplex.com/perspective"
    mc:Ignorable="d"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    d:DesignWidth="640" d:DesignHeight="480"
    Title="Perspective : shapes">
    <swc:TabControl>
        <swc:TabControl.Resources>
            <Style x:Key="BaseShape" TargetType="Shape">
                <Setter Property="Stroke" Value="{StaticResource BasicShapeStroke}" />
                <Setter Property="StrokeThickness" Value="2.0" />
                <Setter Property="Fill" Value="{StaticResource BasicShapeFill}" />
                <Setter Property="Margin" Value="20" />
            </Style>
            <Style TargetType="p:Arrow" BasedOn="{StaticResource BaseShape}"/>
            <Style TargetType="p:Star" BasedOn="{StaticResource BaseShape}"/>
            <Style TargetType="p:RegularPolygon" BasedOn="{StaticResource BaseShape}"/>
            <Style TargetType="p:PieSlice" BasedOn="{StaticResource BaseShape}">
                <Setter Property="Width" Value="120" />
                <Setter Property="Height" Value="120" />
            </Style>
        </swc:TabControl.Resources>
        <swc:TabItem 
            Header="Deep linking"
            Name="deepLinkingTabItem">
            <Viewbox>
                <Grid Margin="20">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="150"/>
                    </Grid.RowDefinitions>
                    <p:RegularPolygon 
                        Name="polygon"
                        SideCount="16"/>
                </Grid>
            </Viewbox>
        </swc:TabItem>        
        <swc:TabItem 
            Header="RegularPolygon"
            IsSelected="True">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <p:RegularPolygon
                    Grid.Column="0"
                    Grid.Row="0"
                    SideCount="3"
                    />
                <p:RegularPolygon
                    Grid.Column="1"
                    Grid.Row="0"
                    />
                <p:RegularPolygon
                    Grid.Column="2"
                    Grid.Row="0"
                    SideCount="12"
                    />
                <p:RegularPolygon
                    Grid.Column="0"
                    Grid.Row="1"
                    SideCount="3"
                    InitialAngle="30"
                    />
                <p:RegularPolygon
                    Grid.Column="1"
                    Grid.Row="1"
                    SideCount="6"
                    InitialAngle="30"
                    />
                <p:RegularPolygon
                    Grid.Column="2"
                    Grid.Row="1"
                    SideCount="12"
                    InitialAngle="30"
                    />
            </Grid>            
        </swc:TabItem>
        <swc:TabItem Header="Star">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <p:Star
                    Grid.Column="0"
                    Grid.Row="0"
                    />
                <p:Star
                    Grid.Column="1"
                    Grid.Row="0"
                    BranchCount="5"
                    InitialAngle="18"
                    />
                <p:Star
                    Grid.Column="2"
                    Grid.Row="0"
                    BranchCount="5"
                    BranchWidth="0.4"
                    InitialAngle="18"
                    />
                <p:Star
                    Grid.Column="0"
                    Grid.Row="1"
                    BranchCount="4"
                    InitialAngle="45"
                    />
                <p:Star
                    Grid.Column="1"
                    Grid.Row="1"
                    BranchCount="8"
                    BranchWidth="0.35"
                    InitialAngle="22.5"
                    />
                <p:Star
                    Grid.Column="2"
                    Grid.Row="1"
                    BranchCount="12"
                    BranchWidth="0.4"
                    InitialAngle="15"
                    />
            </Grid>
        </swc:TabItem>
        <swc:TabItem Header="Arrow">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <p:Arrow
                    Grid.Column="0"
                    Grid.Row="0"
                    />
                <p:Arrow
                    Grid.Column="1"
                    Grid.Row="0"
                    FormatRatio="10"
                    />
                <p:Arrow
                    Grid.Column="0"
                    Grid.Row="1"
                    HeadLengthRatio="0.5"
                    />
                <p:Arrow
                    Grid.Column="1"
                    Grid.Row="1"
                    HeadWidthRatio="4"
                    />
            </Grid>            
        </swc:TabItem>
        <swc:TabItem 
            Header="PieSlice">
            <Viewbox>
                <Grid Margin="20">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <p:PieSlice />
                    <p:PieSlice 
                        InitialAngle="0"
                        Angle="80"/>
                    <p:PieSlice 
                        InitialAngle="90"
                        Angle="80"/>
                    <p:PieSlice 
                        InitialAngle="180"
                        Angle="80"/>
                </Grid>
            </Viewbox>
        </swc:TabItem>        
        <swc:TabItem 
            Header="Checkerboard 1">
            <Viewbox>
                <Grid Margin="20">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="150"/>
                    </Grid.RowDefinitions>
                    <p:Checkerboard
                        Fill="Black"/>
                </Grid>
            </Viewbox>
        </swc:TabItem>
        <swc:TabItem 
            Header="Checkerboard 2">
            <Viewbox>
                <Grid Margin="20">
                    <Grid.Resources>
                        <Style TargetType="p:Checkerboard">
                            <Setter Property="Stroke" Value="{StaticResource BasicShapeStroke}" />
                            <Setter Property="StrokeThickness" Value="1.0" />
                            <Setter Property="Fill" Value="{StaticResource BasicShapeFill}" />
                            <Setter Property="ColumnCount" Value="9"/>
                            <Setter Property="RowCount" Value="6"/>
                            <Setter Property="CellLength" Value="50"/>
                        </Style>
                    </Grid.Resources>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="150"/>
                    </Grid.RowDefinitions>
                    <p:Checkerboard />
                </Grid>
            </Viewbox>
        </swc:TabItem>
        <swc:TabItem 
            Header="{Binding Path=ShapeDemo_Dynamic}">
            <StackPanel>
                <Button 
                    Name="bCreateShape"
                    Width="80" Height="40"
                    Click="bCreateShape_Click"
                    Content="{Binding Path=ShapeDemo_Create}"/>
                <StackPanel Name="shapeStackPanel" />
            </StackPanel>
        </swc:TabItem>
    </swc:TabControl>
</navigation:Page>
